<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-07-26 09:43:37
 * @LastEditTime: 2019-08-09 19:52:03
 * @LastEditors: Please set LastEditors
 -->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .box {
            margin: 100px auto;
            width: 300px;
            height: 300px;
        }

        form {}

        fieldset {
            /* display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-between; */
            text-align: center;
            width: 300px;
            height: 300px;
        }

        .box2 {
            text-align: center;
            margin-bottom: 30px;
            display: flex;
            justify-content: space-between;

        }



        input {
            width: 200px
        }
    </style>
</head>

<body>
    <div class="box">

        <form action="">
            <fieldset style="border-color: crimson">

                <legend>注册</legend>
                <h3>新用户注册</h3>
                <div class="box2">
                    <label for="name">用户名：</label>
                    <input type="text" id="name" placeholder="请输入用户">
                </div>
                <div class="box2">
                    <label for="password">密码：</label>
                    <input type="password" name="password" id="password" placeholder="密码">
                </div>
                <div class="box2">
                    <label for="bgword">重复密码：</label><input type="password" name="password" id="bgword"
                        placeholder="密码">
                </div>
                <input type="button" value="注册" id="btn">
            </fieldset>

        </form>
    </div>
</body>
<script>
    // (function () {

    //     var name = document.getElementById('name');
    //     var password = document.getElementById('password');
    //     var bgword = document.getElementById('bgword');
    //     var btn = document.getElementById('btn');


    // })();


    function sun(arr) {

        for (var i = 0; i < arr.length - 1; i++) {
            for (var j = 0; j < arr.length - 1; j++) {
                if (Number(arr[j]) <
                    Number(arr[j + 1])) {
                    var m = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = m;
                }
            }

        }
        return arr;
    }

    var a = [1, 4, 6, 5, 2]
    console.log(sun(a));
</script>

</html>